/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_Studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#include "构建逻辑节点.h"

#include "节点/逻辑/执行节点.h"



static void on_参数修改(S_Props& prop) {
	//switch ((*(S_PropValueEnum*)prop.m_Value).m_当前选项)
	auto nodes = f_global_get激活节点();
	for (auto 节点 : nodes) {
		节点->f_set是否要更新(true);

		for (auto& panel : 节点->m_包含在多个视口的UI部件) {
			C_节点面板* 节点面板 = static_cast<C_节点面板*>(panel);
			C_节点视口* view = static_cast<C_节点视口*>(节点面板->m_节点当前所在视口);
			节点面板->m_属性面板参数构建(view->m_属性栏, (S_结构指针)节点面板);
		}
	}
}

static void on_参数修改_重新编译(S_Props& prop) {
	//switch ((*(S_PropValueEnum*)prop.m_Value).m_当前选项)
	auto nodes = f_global_get激活节点();
	for (auto 节点 : nodes) {
		节点->f_更新上层节点(true);

		for (auto& panel : 节点->m_包含在多个视口的UI部件) {
			C_节点面板* 节点面板 = static_cast<C_节点面板*>(panel);
			C_节点视口* view = static_cast<C_节点视口*>(节点面板->m_节点当前所在视口);
			节点面板->m_属性面板参数构建(view->m_属性栏, (S_结构指针)节点面板);
		}
	}
}




static void f_手动执行节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	//S_Props	prop = f_alloc_OpsProp(f_Operator初始化跟踪点, obj);
	//plane->m_属性.push_back(prop);
	//f_区管理_设置当前操作节点(((C_节点面板*)obj)->m_NodeData);
	C_手动执行节点* node = dynamic_cast<C_手动执行节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;

	//S_Props	prop = f_alloc_OpsProp(node->m_执行Ops, u"执行");
	//props.push_back(prop);
	plane->f_构建属性部件(props);

}



C_节点面板* f_节点构建_手动执行(S_UI渲染环境& ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) node = new C_手动执行节点(ctx.m_Ctx);

	//if (plane) {
	//	f_节点重置_手动执行(plane, node);
	//	plane->m_属性面板参数构建 = f_手动执行节点_部件构建属性;
	//}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	plane = f_节点创建_UI面板构建(ctx, node, E_节点区类型::e_节点区_节点视图);
	return plane;
}

void f_节点重置_手动执行(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_手动执行节点_部件构建属性;
	plane->m_ICO = u"runcontrol";
}






static void f_循环迭代节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_循环迭代节点* node = dynamic_cast<C_循环迭代节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	plane->f_构建属性部件(props);
}
C_节点面板* f_节点构建_循环迭代(S_UI渲染环境& ctx, S_设备环境& dev_ctx, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_循环迭代节点(ctx.m_Ctx);
		node->m_ICO = u"ico_循环0000";
	}
	//if (plane == nullptr) {
	//	plane = f_节点创建_UI面板构建(ctx, node, E_节点区类型::e_节点区_节点视图);
	//}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_循环迭代(plane, node);
	return plane;
}

void f_节点重置_循环迭代(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_循环迭代节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_循环节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_循环节点* node = dynamic_cast<C_循环节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_开启多线程.m_UI->m_Update = on_参数修改_重新编译;
	props.push_back(node->m_开启多线程);

	if (f_prop_Bool(node->m_开启多线程)) {
		node->m_最大线程数.m_UI->m_Update = on_参数修改;
		props.push_back(node->m_最大线程数);
	}

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_循环(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_循环节点(ctx_3d);
		node->m_ICO = u"ico_循环0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_循环(plane, node);
	return plane;
}

void f_节点重置_循环(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_循环节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}



static void f_多维循环节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_多维循环节点* node = dynamic_cast<C_多维循环节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_开启多线程.m_UI->m_Update = on_参数修改_重新编译;
	props.push_back(node->m_开启多线程);

	if (f_prop_Bool(node->m_开启多线程)) {
		node->m_最大线程数.m_UI->m_Update = on_参数修改;
		props.push_back(node->m_最大线程数);
	}

	node->m_维度.m_UI->m_Update = on_参数修改_重新编译;
	props.push_back(node->m_维度);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_多维循环(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_多维循环节点(ctx_3d);
		node->m_ICO = u"ico_循环0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_逻辑);
	f_节点重置_多维循环(plane, node);
	return plane;
}

void f_节点重置_多维循环(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_多维循环节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_迭代节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_迭代节点* node = dynamic_cast<C_迭代节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_开启多线程.m_UI->m_Update = on_参数修改_重新编译;
	props.push_back(node->m_开启多线程);

	if (f_prop_Bool(node->m_开启多线程)) {
		node->m_最大线程数.m_UI->m_Update = on_参数修改;
		props.push_back(node->m_最大线程数);
	}

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_迭代(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) node = new C_迭代节点(ctx_3d);
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_迭代(plane, node);
	return plane;
}

void f_节点重置_迭代(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_迭代节点_部件构建属性;
	plane->m_3D视口更新 = nullptr;
	plane->m_ICO = u"ico_循环0000";
}



static void f_多维迭代节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_多维迭代节点* node = dynamic_cast<C_多维迭代节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_开启多线程.m_UI->m_Update = on_参数修改_重新编译;
	props.push_back(node->m_开启多线程);

	if (f_prop_Bool(node->m_开启多线程)) {
		node->m_最大线程数.m_UI->m_Update = on_参数修改_重新编译;
		props.push_back(node->m_最大线程数);
	}

	node->m_维度.m_UI->m_Update = on_参数修改_重新编译;
	props.push_back(node->m_维度);

	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_多维迭代(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_多维迭代节点(ctx_3d);
		node->m_ICO = u"ico_循环0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_多维迭代(plane, node);
	return plane;
}

void f_节点重置_多维迭代(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_多维迭代节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}


static void f_循环尾节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_循环尾节点* node = dynamic_cast<C_循环尾节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	plane->f_构建属性部件(props);
}
C_节点面板* f_节点构建_循环尾(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) node = new C_循环尾节点(ctx_3d);
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_循环尾(plane, node);
	return plane;
}
void f_节点重置_循环尾(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_循环尾节点_部件构建属性;
	plane->m_ICO = u"ico_循环0000";
}




static void f_输入组节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_输入组节点* node = dynamic_cast<C_输入组节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	plane->f_构建属性部件(props);
}
C_节点面板* f_节点构建_输入组(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) node = new C_输入组节点(ctx_3d);
	//if (plane == nullptr) {
	//	plane = f_节点创建_UI面板构建(ctx, node, E_节点区类型::e_节点区_节点视图);
	//}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_输入组(plane, node);
	return plane;
}
void f_节点重置_输入组(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_输入组节点_部件构建属性;
	plane->m_3D视口更新 = nullptr;
	plane->m_ICO = u"ico_循环0000";
}




static void f_输出组节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_输出组节点* node = dynamic_cast<C_输出组节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	plane->f_构建属性部件(props);
}
C_节点面板* f_节点构建_输出组(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) node = new C_输出组节点(ctx_3d);
	//if (plane == nullptr) {
	//	plane = f_节点创建_UI面板构建(ctx, node, E_节点区类型::e_节点区_节点视图);
	//}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_输出组(plane, node);
	return plane;
}
void f_节点重置_输出组(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_输出组节点_部件构建属性;
	plane->m_3D视口更新 = nullptr;
	plane->m_ICO = u"ico_循环0000";
}




static void f_全局变量节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_全局变量节点* node = dynamic_cast<C_全局变量节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);


	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_全局变量(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_全局变量节点(ctx_3d);
		node->m_ICO = u"ico_循环0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_逻辑);
	f_节点重置_全局变量(plane, node);
	return plane;
}

void f_节点重置_全局变量(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_全局变量节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_成员变量节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_成员变量节点* node = dynamic_cast<C_成员变量节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);


	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_成员变量(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_成员变量节点(ctx_3d);
		node->m_ICO = u"ico_循环0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_逻辑);
	f_节点重置_成员变量(plane, node);
	return plane;
}

void f_节点重置_成员变量(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_成员变量节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}



static void f_网格属性变量节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_网格属性变量节点* node = dynamic_cast<C_网格属性变量节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);


	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_网格属性变量(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_网格属性变量节点(ctx_3d);
		node->m_ICO = u"ico_循环0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_逻辑);
	f_节点重置_网格属性变量(plane, node);
	return plane;
}

void f_节点重置_网格属性变量(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_网格属性变量节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_跳过节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_跳过节点* node = dynamic_cast<C_跳过节点*>(((C_节点面板*)obj)->m_NodeData);

	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_跳过返回.m_UI->m_Update = on_参数修改_重新编译;
	props.push_back(node->m_跳过返回);

	plane->f_构建属性部件(props);
}
C_节点面板* f_节点构建_跳过(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) node = new C_跳过节点(ctx_3d);
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_跳过(plane, node);
	return plane;
}
void f_节点重置_跳过(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_跳过节点_部件构建属性;
	plane->m_3D视口更新 = nullptr;
	plane->m_ICO = u"ico_循环0000";
}




static void f_分支判断节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_分支判断节点* node = dynamic_cast<C_分支判断节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	node->m_反向.m_UI->m_Update = on_参数修改_重新编译;
	props.push_back(node->m_反向);
	node->m_布尔.m_UI->m_Update = on_参数修改_重新编译;
	props.push_back(node->m_布尔);
	if (!f_prop_Bool(node->m_布尔)) {
		node->m_Case.m_UI->m_Update = on_参数修改;
		props.push_back(node->m_Case);
	}
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_分支判断(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) node = new C_分支判断节点(ctx_3d);
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_分支判断(plane, node);
	return plane;
}

void f_节点重置_分支判断(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_分支判断节点_部件构建属性;
	plane->m_3D视口更新 = nullptr;
	plane->m_ICO = u"0空";
}




static void f_包节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_包节点* node = dynamic_cast<C_包节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_包(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_包节点(ctx_3d, tree);
		node->m_ICO = u"0空";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_包(plane, node);
	return plane;
}

void f_节点重置_包(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板重构(plane, node, E_节点区类型::e_节点区_节点视图);
	f_节点重构_插座重构(plane, node, E_节点区类型::e_节点区_节点视图);

	plane->m_属性面板参数构建 = f_包节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}




static void f_插座路由节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_插座转接节点* node = dynamic_cast<C_插座转接节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_插座转接(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_插座转接节点(ctx_3d, 2);
		node->m_ICO = u"0空";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_插座转接(plane, node);
	return plane;
}

void f_节点重置_插座转接(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_插座路由节点_部件构建属性;
	plane->m_ICO = node->m_ICO;

	plane->f_setMinSize({20, 20});
	plane->m_节点面板宽度 = 20;
	plane->m_图元形状 = &plane->m_UIctx->m_Ctx.m_几何图形->m_平面圆形;
}



static void f_面板框节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_面板框节点* node = dynamic_cast<C_面板框节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_面板框(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_面板框节点(ctx_3d);
		node->m_ICO = u"";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_面板框(plane, node);
	return plane;
}

void f_节点重置_面板框(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_面板框节点_部件构建属性;
	plane->m_ICO = node->m_ICO;

	plane->m_拾取区域大小 = {200,200};
	plane->f_setOriginalSize({200,200});
	plane->f_setSize({200, 200});
}




static void f_轨道采样节点_部件构建属性(C_属性栏* plane, S_结构指针 obj) {
	C_轨道采样节点* node = dynamic_cast<C_轨道采样节点*>(((C_节点面板*)obj)->m_NodeData);
	std::vector<S_Props> props;
	f_节点重构_重构属性面板数据((C_节点面板*)obj, props);

	node->m_启用曲线.m_UI->m_Update = f_节点参数更新_重新编译_属性栏更新;
	props.push_back(node->m_启用曲线);

	if (f_prop_Bool(node->m_启用曲线)) {
		node->m_曲线.m_UI->m_Update = f_节点参数更新;
		props.push_back(node->m_曲线);
	}

	node->m_开启多线程.m_UI->m_Update = f_节点参数更新_重新编译_属性栏更新;
	props.push_back(node->m_开启多线程);

	if (f_prop_Bool(node->m_开启多线程)) {
		node->m_最大线程数.m_UI->m_Update = on_参数修改_重新编译;
		props.push_back(node->m_最大线程数);
	}
	
	
	plane->f_构建属性部件(props);
}

C_节点面板* f_节点构建_轨道采样(S_UI渲染环境& ctx, S_设备环境& ctx_3d, C_节点基类* node, C_节点树* tree, const std::u16string& name) {
	if (!node) {
		node = new C_轨道采样节点(ctx_3d);
		node->m_ICO = u"ico_轨道0000";
	}
	C_节点面板* plane = new C_节点面板(node, ctx, E_节点区类型::e_节点区_物体);
	f_节点重置_轨道采样(plane, node);
	return plane;
}

void f_节点重置_轨道采样(C_节点面板* plane, C_节点基类* node) {
	f_节点重构_面板插座重构(plane, node, E_节点区类型::e_节点区_节点视图);
	plane->m_属性面板参数构建 = f_轨道采样节点_部件构建属性;
	plane->m_ICO = node->m_ICO;
}






void f_逻辑节点_构建函数初始化() {
	C_节点面板::g节点面板构建函数[DEF_多维循环节点] = f_节点构建_多维循环;
	C_节点面板::g节点面板重置函数[DEF_多维循环节点] = f_节点重置_多维循环;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"多维循环"] = DEF_多维循环节点;

	C_节点面板::g节点面板构建函数[DEF_多维迭代节点] = f_节点构建_多维迭代;
	C_节点面板::g节点面板重置函数[DEF_多维迭代节点] = f_节点重置_多维迭代;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"多维迭代"] = DEF_多维迭代节点;

	C_节点面板::g节点面板构建函数[DEF_轨道采样节点] = f_节点构建_轨道采样;
	C_节点面板::g节点面板重置函数[DEF_轨道采样节点] = f_节点重置_轨道采样;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"轨道采样"] = DEF_轨道采样节点;

	C_节点面板::g节点面板构建函数[DEF_全局变量节点] = f_节点构建_全局变量;
	C_节点面板::g节点面板重置函数[DEF_全局变量节点] = f_节点重置_全局变量;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"全局变量"] = DEF_全局变量节点;

	C_节点面板::g节点面板构建函数[DEF_成员变量节点] = f_节点构建_成员变量;
	C_节点面板::g节点面板重置函数[DEF_成员变量节点] = f_节点重置_成员变量;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"成员变量"] = DEF_成员变量节点;

	C_节点面板::g节点面板构建函数[DEF_网格属性变量节点] = f_节点构建_网格属性变量;
	C_节点面板::g节点面板重置函数[DEF_网格属性变量节点] = f_节点重置_网格属性变量;
	C_节点面板::g节点构建函数_创建名称对应类型名称[u"网格属性变量"] = DEF_网格属性变量节点;
}




bool f_逻辑节点重构(C_节点面板** plane, C_节点基类* node, S_UI渲染环境* ctx) {
	if (node->m_TypeName == DEF_循环头节点) {
		if (!plane[0]) plane[0] = f_节点构建_循环迭代(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_循环迭代(plane[0], node);
	}
	else if (node->m_TypeName == DEF_输入组节点) {
		if (!plane[0]) plane[0] = f_节点构建_输入组(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_输入组(plane[0], node);
	}
	else if (node->m_TypeName == DEF_输出组节点) {
		if (!plane[0]) plane[0] = f_节点构建_输出组(*ctx, *S_节点框架::g_3D视口环境, node);
		else f_节点重置_输出组(plane[0], node);
	}
	
	else {
		return false;
	}

	return true;
}





